import service from './http'
//获取权限
export function getRight(){
  return service({
    url:'rights/list',
    method:'get',
  })
}
// 获取角色
export function getRoles(){
  return service({
    url:'roles',
    method:'get'
  })
}
// 删除角色
export function deleteRoles(roled,rightId){
  return service({
    url:`roles/${roled}/rights/${rightId}`,
    method:'delete'
  })
}
//获取节点树
export function getRolesTree(){
  return service({
    url:'rights/tree',
    method:'get',
  })
}
//授权
export function getpower(id,nodeId){
  return service({
    url:`roles/${id}/rights`,
    method:'post',
    data:{
      rids:nodeId
    }
  })
}